`include "PRV564Config.v"
`include "PRV564Define.v"
module ScoreBoard(
    input wire      Global_CLK,
    input wire      Global_ARST,
    input wire      Global_Flush,
    //--------write port-------
    input wire      wren,
    input wire [4:0]wr_rd_index,
    //------check port--------
    input wire      chk_rs1en,
    input wire [4:0]chk_rs1index,
    input wire      chk_rs2en,
    input wire [4:0]chk_rs2index,
    output wire     chk_depdc,
    //--------read port--------
    input wire      rden,
    input wire [4:0]rd_rd_index
);
reg [31:0] Board;
always@(posedge Global_CLK or posedge Global_ARST)begin
    if(Global_ARST)begin
        Board <= 32'b0;
    end
    else if(Global_Flush)begin
        Board <= 32'b0;
    end
    if(wren & (wr_rd_index!=5'b0))begin
        Board[wr_rd_index] <= 1'b1;
    end
    if(rden & (rd_rd_index!=5'b0))begin
        Board[rd_rd_index] <= 1'b0;
    end
end
assign chk_depdc = (chk_rs1en & Board[chk_rs1index]) | (chk_rs2en & Board[chk_rs2index]);

endmodule